<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <title>Document</title>
    <style>
        canvas{
            border: 1px solid black;
            display: block;
            margin: 0 auto;
        }
    </style>
</head>
<canvas id="myCanvas" width="500px" height="500px">
    您的浏览器不支持canvas，请更换浏览器
</canvas>
<script>
    var myCanvas = document.getElementById('myCanvas');
    var paint = myCanvas.getContext('2d');
    
  
    
    var grd1 = paint.createRadialGradient(75,50,5,90,60,100);
    grd1.addColorStop(0,'yellow');
    grd1.addColorStop(0.5,'blue');
    grd1.addColorStop(1,'white');
    paint.fillStyle = grd1;
    paint.fillRect(10,10,150,80);
   
   

</script>

<body>

</body>

</html>